#include<bits/stdc++.h>
using namespace std;
int cnt[100500],a[100500],j=1,n,ans,x;
vector<int>b,flag;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=0;i<n;i++)cin>>a[i],cnt[a[i]]++;
    //sort(a,a+n);
    for(int i=0;i<100500;i++){
        if(cnt[i]>0)b.push_back(i),flag.push_back(cnt[i]);
    }
    for(int i=0;i<b.size();i++){
        while(cnt[b[i]]>0){
            //cout<<cnt[b[i]]<<" "<<flag[j]<<endl;
            while(i>=j)j++;
            if(j>=flag.size())break;
            x=min(cnt[b[i]],flag[j]);
            flag[j]-=x;
            cnt[b[i]]-=x;
            if(flag[j]==0)j++;
        }
        //for(int i=0;i<b.size();i++)cout<<b[i]<<" "<<cnt[b[i]]<<" "<<flag[i]<<endl;
        //cout<<endl;
    }
    for(int i=0;i<100500;i++)ans+=cnt[i];
    cout<<ans<<endl;
    return 0;
}
